/***************************************************************************
 * The Open Armory API is a project to retrieve World of Warcraft(R) 
 * related XML data from The Armory.
 * 
 * The data retrieved via the Open Armory API from The Armory is 
 * proprietary to Blizzard Entertainment, Inc(R).
 * *************************************************************************
 * Copyright (C) 2009 - 2010 Tedla M.B. Brandsema
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ***************************************************************************/
package net.openarmory.core.domain.constants;

// TODO: Auto-generated Javadoc
/**
 * The Enum Race.
 */
public enum CharacterRace implements CharacterEnum {

	/** The HUMAN. */
	HUMAN(1),

	/** The ORC. */
	ORC(2),

	/** The DWARF. */
	DWARF(3),

	/** The NIGH t_ elf. */
	NIGHT_ELF(4),

	/** The UNDEAD. */
	UNDEAD(5),

	/** The TAUREN. */
	TAUREN(6),

	/** The GNOME. */
	GNOME(7),

	/** The TROLL. */
	TROLL(8),

	/** The GOBLIN. */
	GOBLIN(9),

	/** The BLOO d_ elf. */
	BLOOD_ELF(10),

	/** The DRAENEI. */
	DRAENEI(11),

	/** The WORGEN. */
	WORGEN(22);

	/** The numerical representation. */
	private int numericalRepresentation;

	/**
	 * Instantiates a new race.
	 * 
	 * @param numericalRepresentation
	 *            the numerical representation of the race.
	 */
	private CharacterRace(final int numericalRepresentation) {
		this.numericalRepresentation = numericalRepresentation;
	}

	/**
	 * Gets the numerical representation.
	 * 
	 * @return the numerical representation
	 */
	@Override
	public int getNumericalRepresentation() {
		return this.numericalRepresentation;
	}

	/**
	 * Gets the string values.
	 * 
	 * @return the string values
	 */
	public static String getStringValues() {
		final StringBuilder concat = new StringBuilder();
		for (final CharacterRace characterRace : CharacterRace.values()) {
			concat.append(characterRace.getConsoleParameterValue() + ", ");
		}
		return concat.toString().replaceAll(", $", "");
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * net.openarmory.domain.constants.ConsoleEnum#getConsoleParameterValue()
	 */
	@Override
	public String getConsoleParameterValue() {
		switch (this) {
		case HUMAN:
			return "Human";
		case ORC:
			return "Orc";
		case DWARF:
			return "Dwarf";
		case NIGHT_ELF:
			return "Night Elf";
		case UNDEAD:
			return "Undead";
		case TAUREN:
			return "Tauren";
		case GNOME:
			return "Gnome";
		case TROLL:
			return "Troll";
		case GOBLIN:
			return "GOBLIN";
		case BLOOD_ELF:
			return "Blood Elf";
		case DRAENEI:
			return "Draenei";
		case WORGEN:
			return "Worgen";
		default:
			return null;
		}
	}
}
